<HTML>

<HEAD>
	<TITLE>EETransfer Off-line documentation</TITLE>
</HEAD>

<BODY BACKGROUND="pict/fond.gif" BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#FF0000" VLINK="#FF0000">

<TABLE WIDTH=598 BORDER=0 CELLPADDING=0 CELLSPACING=0>


<TR >
		<TD WIDTH=120 ALIGN="center" NOWRAP>
		<A HREF="mailto:mail@easter-eggs.com" >
		<IMG SRC="pict/mailee.gif" ALT="Mail to EE" WIDTH=81 HEIGHT=19 BORDER=0>
		</A>
		</TD>

		<TD WIDTH=20 NOWRAP>
		</TD>
		
		<TD WIDTH=5 NOWRAP>
		</TD>
		
		<TD WIDTH=226  ALIGN="center" VALIGN="top" NOWRAP>
		<IMG SRC="pict/logo.gif" WIDTH=100 HEIGHT=100 BORDER=0>
		</TD>


		<TD WIDTH=227 VALIGN="center" NOWRAP>
		<H1>EETransfer Programmer's Guide</H1>
		<FONT SIZE=+2><B>Off-line documentation</B></FONT>
		</TD>
		


</TR>

<TR >
		<TD WIDTH=120 >
		</TD>

		<TD WIDTH=20 >
		</TD>
		
		<TD WIDTH=5>
		</TD>

		<TD WIDTH=453  COLSPAN=2>
		<IMG SRC="pict/bbar.gif" WIDTH=453 HEIGHT=30 BORDER=0>
		</TD>


</TR>
	
<TR >
		<TD WIDTH=120 VALIGN="top">
		<center>
		<IMG SRC="pict/eetransf.gif" WIDTH=120 HEIGHT=20>
		<BR><BR>
		<A HREF="http://www.easter-eggs.com/eetransfer/docsum.html"><FONT SIZE=+2><B>On-line Documentation</B></FONT></A>
		</center>
		</TD>

		<TD WIDTH=20 >
		</TD>
		
		<TD WIDTH=5>
		</TD>

		<TD WIDTH=226  ALIGN="left">
		<B>
		<a href="#intro">An Introduction to the script engine</A>
		<BR><BR>
		<A HREF="eetdoc/ConnectAppleTalk.html">ConnectAppleTalk</A>
		<BR>
		<A HREF="eetdoc/ConnectIrDA.html">ConnectIrDA</A>
		<BR>
		<A HREF="eetdoc/ConnectModem.html">ConnectModem</A>
		<BR>
		<A HREF="eetdoc/ConnectSerial.html">ConnectSerial</A>
		<BR>
		<A HREF="eetdoc/for.html">For</A>
		<BR>
		<A HREF="eetdoc/ForEachItemRequest.html">ForEachItemRequest</A>
		<BR>
		<A HREF="eetdoc/ForEachReadyItem.html">ForEachReadyItem</A>
		<BR>
		<A HREF="eetdoc/ForEachRemoteItem.html">ForEachRemoteItem</A>
		<BR>
		<A HREF="eetdoc/ReceiveRaw.html">ReceiveRaw</A>
		<BR>
		<A HREF="eetdoc/ReceiveXModem.html">ReceiveXModem</A>
		<BR>
				
		</B>
		</TD>
		<TD WIDTH=227  ALIGN="left">
		<BR><BR>
		<B>
		<A HREF="eetdoc/ReceiveZModem.html">ReceiveZModem</A>
		<BR>
		<A HREF="eetdoc/Resume.html">Resume</A>
		<BR>
		<A HREF="eetdoc/SendATEscape.html">SendATEscape</A>
		<BR>
		<A HREF="eetdoc/SendRaw.html">SendRaw</A>
		<BR>
		<A HREF="eetdoc/SendString.html">SendString</A>
		<BR>
		<A HREF="eetdoc/SendXModem.html">SendXModem</A>
		<BR>
		<A HREF="eetdoc/SendZModem.html">SendZModem</A>
		<BR>
		<A HREF="eetdoc/Try.html">Try</A>
		<BR>
		<A HREF="eetdoc/WaitForLine.html">WaitForLine</A>
		<BR>
		<A HREF="eetdoc/WaitForString.html">WaitForString</A>
		<BR>
		</B>

	</TD>

</TR>
<TR >
		<TD WIDTH=120 >
		</TD>

		<TD WIDTH=20 >
		</TD>
		
		<TD WIDTH=5>
		</TD>

		<TD WIDTH=453  COLSPAN=2>
		<HR>
		<FONT SIZE=+2><B><A NAME="intro">An Introduction to the script engine</A></B></FONT>
		<BR><BR>
		 An instruction can be either:<BR><BR>

	* <B>a frame</B> with a slot <B>toolSymbol</B>, whose value is a symbol
which identifies the instruction<BR>

	* an <B>array of instructions</B>, which indicates a sequence of
instructions<BR>

	* <B>nil</B>, which is a no-operation instruction
	<BR>
	* a <B>function</B> with no argument which returns an instruction
	<BR>
	*	one of the following <B>symbols</B>: <B>'ok, 'warning, 'error, 'cancelled</B>
	<BR><BR>
		<B>'ok</B> Indicates that the script has not
encountered any problem (yet), so its execution can continue (same as nil).
	<BR>
		<B>'warning</B> Indicates that a minor error has occured.
The currently executing instruction sequence is aborted and the execution
resumes at the first enclosing "Try" instruction with a "warning" option
(see the "Try" instruction).
	<BR>
		<B>'error</B> Indicates that a critical error has occured. the
currently executing instruction sequence is aborted and the execution
resumes at the first enclosing "Try" instruction with an "error" option
(see the "Try" instruction).
	<BR>
		<B>'cancelled</B> Indicates that the script execution has
been cancelled. the currently executing instruction sequence is aborted and
the execution resumes at the first enclosing "Try" instruction with an
"cancelled" option (see the "Try" instruction).

	<BR><BR>

When an instruction frame is executed, all the slots contained in the frame
are used as parameters for the instruction. Each of the slot defined in the
frame of global variables is also used as a parameter (unless a slot with
the same name is already defined in the instruction frame).
<BR>
When the instruction frame execution ends, all the slots defined in the
frame of global variables are set to their new value.
<BR>

<HR>
An instruction frame can optionaly contain a special slot named
"<B>globalSymbols</B>". This slot must be a frame of slots whose values are
symbols. Each of these slots corresponds to a parameter for the
instruction. The name of the parameter is the slot name; the value of the
parameter is the global variable whose name is the slot value.
<BR>
If the slot "<B>globalSymbols</B>" is defined, only the global variables whose
name are in the "<B>globalSymbols</B>" frame are used as parameters for the
instruction. The other global variables are not used as parameters. So, if
an instruction contains a "<B>globalSymbols</B>" slot, it must contains all the
global variables used by that instruction.
<BR><BR>
<I>For an example of using global variables, consider the following script:</I>
<IMG SRC="pict/bbar.gif" WIDTH=450 HEIGHT=30 BORDER=0>

		</TD>

		
</TR>

<TR>
		<TD  BGCOLOR="#C0C0C0" COLSPAN=5>
<PRE>
globals: {
	connectionTool: nil,	// Set by the ConnectSerial instruction
	endpoint: nil,			// Set by the ConnectSerial instruction
	transport: nil,			// Set by EETransfer at the script startup
	},
instruction: [
		{
		toolSymbol: 'ConnectSerial,
		bps: k9600bps,
		globalSymbols: {
					endpoint: 'endpoint,
					machine: 'connectionTool,
					transport: 'transport,
				},
		},
		...
		{
			toolSymbol: 'Resume,
			globalSymbols: {
					machine: 'connectionTool,
				},
		},
	]
</PRE>
		</TD>
</TR>


<TR >
		<TD WIDTH=120 >
		</TD>

		<TD WIDTH=20 >
		</TD>
		
		<TD WIDTH=5>
		</TD>

		<TD WIDTH=453  COLSPAN=2>
<BR><BR>
The first instruction frame tells the transport defined in the global
variable "<B>transport</B>" (ie EETransfer) to launch a serial connection at 9600
bps. When the Newton is connected, the instruction pauses, and the value of
the "<B>machine</B>" slot (which contains the state of the instruction) is copied
into the global variable "<B>connectionTool</B>". In the same way, the value of
the "<B>endpoint</B>" slot (which contains the endpoint created for the
connection) is copied into the global variable "<B>endpoint</B>".
<BR><BR>
The last instruction frame executes the "<B>Resume</B>" instruction with a single
parameter. This parameter is named "<B>machine</B>" and its value is the value of
the global variable "<B>connectionTool</B>". So this instruction resumes the
previously paused "<B>ConnectSerial</B>" instruction, which has the effect of
closing the serial connection.
<BR><BR>
<I>Note: When a script execution ends, all the paused instructions are
automatically resumed. So the following example is better way to do the
same thing as the previous script.</I>
<BR>
<IMG SRC="pict/bbar.gif" WIDTH=450 HEIGHT=30 BORDER=0>
		</TD>


</TR>
<TR>
		<TD  BGCOLOR="#C0C0C0" COLSPAN=5>
<PRE>
globals: {
		endpoint: nil,			// Set by the ConnectSerial instruction
		transport: nil,			// Set by EETransfer at the script startup
		},
instruction: [
		{
		toolSymbol: 'ConnectSerial,
		bps: k9600bps,
		},
		...
	]
</PRE>
		</TD>
</TR>

<TR >
		<TD WIDTH=120 >
		</TD>

		<TD WIDTH=20 >
		</TD>
		
		<TD WIDTH=5>
		</TD>

		<TD WIDTH=453  COLSPAN=2>
		<IMG SRC="pict/bbar.gif" WIDTH=453 HEIGHT=30 BORDER=0>
		</TD>


</TR>

<TR >
		<TD WIDTH=120 >
		</TD>

		<TD WIDTH=20 >
		</TD>
		
		<TD WIDTH=5>
		</TD>

		<TD WIDTH=453  COLSPAN=2>
		<IMG SRC="pict/bar.gif" WIDTH=453 HEIGHT=30 BORDER=0>
		</TD>


</TR>

<TR >
		<TD WIDTH=120 >
		&copy;1997 Easter-eggs<BR>
		All trademarks mentioned are the property of their respective owners
		</TD>

		<TD WIDTH=20 >
		</TD>
		
		<TD WIDTH=5>
		</TD>
		
		<TD WIDTH=226  VALIGN="top">
		</TD>


		<TD WIDTH=227 ALIGN="right" VALIGN="top">
		</TD>
		


</TR>


</TABLE>

</BODY>

</HTML>